/**
 * 
 */
Ext.define("wufe.util.map.MapPluginCommand", {
			extend : 'OpenLayers.Control',
			// 定义属性
			mapWrap : null,
			// 定义类 初始化函数
			init : function(p_mapClass) {
				this.mapWrap = p_maplass;
				this.setMap(this.mapWrap.map);
			},
			constructor : function(p_mapClass, options) {
				this.init(p_mapClass);
				Ext.apply(this,options);
				//
				this.events = new OpenLayers.Events(this, null,
						this.EVENT_TYPES);
				if (this.eventListeners instanceof Object) {
					this.events.on(this.eventListeners);
				}
				if (this.id == null) {
					this.id = OpenLayers.Util.createUniqueID(this.self.getName()
							+ "_");
				}
			},
			// ---------------------------------------------
			/**
			 * Method: activate Activates the control.
			 * 
			 * Returns: {Boolean} The control was effectively activated.
			 */
			activate : function() {
				if (!this.active) {
					for (var i in this.handlers) {
						this.handlers[i].activate();
					}
				}
				return OpenLayers.Control.prototype.activate.apply(this,
						arguments);
			},

			/**
			 * Method: deactivate Deactivates the control.
			 * 
			 * Returns: {Boolean} The control was effectively deactivated.
			 */
			deactivate : function() {
				if (this.active) {
					for (var i in this.handlers) {
						this.handlers[i].deactivate();
					}
				}
				return OpenLayers.Control.prototype.deactivate.apply(this,
						arguments);
			},
			// ---------------------------------------------
			// 释放类
			dispose : function() {
				this.deactivate();
			},
			// 定义单击事件
			onClick : function() {
				if (cmToolBar != null) {
					cmToolBar.deactivateItems();
				}
				this.activate(); // 激活控件
			}			
		});